package com.nsl.my_youlai.common.model;

import com.fasterxml.jackson.annotation.JsonInclude;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;



/**
 * 用于 element plus 的 select
 * @param <T>
 */
@Data
@NoArgsConstructor
public class ElSelectOption<T> {

    public ElSelectOption(T value, String label) {
        this.value = value;
        this.label = label;
    }

    public ElSelectOption(T value, String label, List<ElSelectOption> children) {
        this.value = value;
        this.label = label;
        this.children= children;
    }

    //@Schema(description="选项的值")
    private T value;

    //@Schema(description="选项的标签")
    private String label;

    //@Schema(description="子选项列表")
    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    private List<ElSelectOption> children;

}